{template 'header'}
    <link rel="stylesheet" href="{MODULE_URL}assets/css/pic_look.css">
    <style>
        #top_tab li{
            line-height: 3;
            color: #333;
            background: #fff;
            border-top: 1px solid #d7d7d7;
        }
        #top_tab .mui-active{
            color: #007aff;
        }
        #slider h4{
            font-size: 14px;
        }
        #slider p{
            font-size: 12px;
        }
        .numm ul li{
            background: #fff;
            text-align: center;
        }
        .numm ul li:after{
            background-color:#fff;
        }
        .noting{
            line-height: 2;
            text-align: center;
            font-size: 14px !important;
        }
    </style>
</head>
<body>
    <!-- 头部 结束 -->
    <div class="mui-content">
        <div class="numm">
            <ul class="mui-table-view mui-row">
                <li class="mui-table-view-cell mui-col-sm-6 mui-col-xs-6"><p>团队人数 <span class="mui-badge mui-badge-warning mui-badge-inverted">{$teamcount}</span>人</p></li>
                <li class="mui-table-view-cell mui-col-sm-6 mui-col-xs-6"><p>历史佣金 <span class="mui-badge mui-badge-danger mui-badge-inverted">{$tgyj}</span>元</p></li>
            </ul>
        </div>
        <div class="mui-slider" id="slider">
            <div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" id="top_tab">
                <li class="mui-control-items mui-col-xs-6 mui-inline mui-active">一级用户</li>
                <li class="mui-control-items mui-col-xs-6 mui-inline">二级用户</li>
            </div>
            <div class="mui-slider-progress-bar mui-col-xs-6"></div> <!--选项卡滑动条-->
            <div class="mui-slider-group" id='tab_content'>
                <div class="mui-slider-item mui-control-content mui-active">
                    <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed data_list">
                        {loop $child $item}
                        <li class="mui-table-view-cell">
                            <div class="mui-table">
                                <div class="mui-table-cell mui-col-xs-10">
                                    <h5>会员ID: {$item['id']} </h5>
                                    <h5>手机号码:{$item['mobile']}</h5>
                                    <p class="time">用户等级:<span class="mui-badge mui-badge-danger mui-badge-inverted">{$item['user_vip']}</span></p>
                                </div>
                            </div>
                        </li>
                        {/loop}
                    </ul>
                </div>
                <div class="mui-slider-item mui-control-content">
                    <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed data_list">
                        {loop $child_child $item}
                        <li class="mui-table-view-cell">
                            <div class="mui-table">
                                <div class="mui-table-cell mui-col-xs-10">
                                    <h5>会员ID: {$item['id']} </h5>
                                    <h5>手机号码:{$item['mobile']}</h5>
                                    <p class="time">用户等级:<span class="mui-badge mui-badge-danger mui-badge-inverted">{$item['user_vip']}</span></p>
                                </div>
                            </div>
                        </li>
                        {/loop}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <script src="{MODULE_URL}assets/js/jquery.min.js"></script>
	<script src="{MODULE_URL}assets/js/mui.min.js"></script>
    <!-- 以上为引入第三方插件 -->
    <script>
        //初始化 mui 顶部 tab 效果
		mui('#slider').slider({
			interval:0 // slider间隔时间
		});
        //实现鼠标点击切换效果
        $('#top_tab li').click(function(){
            var gallery = mui('#slider');
            $('#top_tab li').removeClass('mui-active')
            $(this).addClass('mui-active')
            gallery.slider().gotoItem($(this).index())
        });
        // 动态添加 top_tab 的 active
        document.querySelector('#slider').addEventListener('slide', function(event) {
            var index = event.detail.slideNumber;
            $('#top_tab li').removeClass('mui-active');
            $('#top_tab li').eq(index).addClass('mui-active')
        });
        for(let i = 0; i < $('.data_list').length ; i++){
            if($('.data_list').eq(i).children('li').length == 0){
                $('.data_list').eq(i).parent().css('border','none');
                $('.data_list').eq(i).after('<p class="noting">暂无数据</p>')
            }
        }
    </script>
</body>
</html>